<template>
    <view>
		<view style="margin-left: 20rpx;margin-right: 20rpx;font-size: 15px;">
		 <u-parse :content="content" />
		</view>

        <!--加载框 start-->
        <tui-loading :visible="loading"></tui-loading>
        <!--加载框 end-->
    </view>
</template>

<script>

import uParse from '@/components/u-parse/u-parse.vue'
import tuiLoading from "../../components/loading/loading";
/*
* Author: 郭少
* github: https://github.com/guoshao99/wallpaper-applet
* gitee: https://gitee.com/guoshao99/wallpaper-applet
* QQ：2549789059
* 微信：2549789059
*/
const Constant = require('../../utils/constants');

const util = require('../../utils/util.js');


const http = require('../../utils/http.js');

let setinad;
export default {
		components: {
		  tuiLoading,
		  uParse
		},
		data() {
            return {
              pagead: 2,
              pageadB: 0,
              thisPage: 'notice',
              noticeId: '',

              noticeObj: {
                content: ""
              },

              content: "",
              loading: false
            };
        },
onLoad: function (options) {
  this.setData({
    noticeId: options.id
  });
  this.loadNotice();
},
onShow(options) {
  util.getshare(this);
  var that = this;
},
onHide() {
  clearInterval(setinad);
},
onShareAppMessage: function () {
  var that = this;
  uni.showShareMenu({
    withShareTicket: true,
    menus: ['shareAppMessage', 'shareTimeline']
  });
  return {
    title: that.shares.share_title,
    imageUrl: that.shares.share_image
  };
},
//转发朋友圈
onShareTimeline: function () {
  var that = this;
  return {
    title: that.shares.share_title,
    imageUrl: that.shares.share_image
  };
},

methods: {


    loadNotice: function () {
      let that = this;
	  that.loading = true;
      var params = {
        url: "/notice/getById",
        method: "GET",
        data: {
          id: that.noticeId
        },
        callBack: function (res) {
			that.loading = false;
          if (res.code == 200) {
			that.content = that.escape2Html(res.data.content);
            that.setData({
              noticeObj: res.data
            });
          } else {
            uni.showToast({
              title: res.msg,
              icon: 'fail',
              duration: 2000
            });
          }
        }
      };
      http.request(params);
    }
}
                };
</script>
<style>
@import url("/components/u-parse/u-parse.css");
@import './notice.css';
</style>
